import {Component} from '@angular/core';
import {Router} from '@angular/router';
import {Setting} from './public/setting/setting';
import {SettingUrl} from './public/setting/setting_url';
import {MENUS} from './public/setting/menus';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {

  constructor(public router: Router) {
    //判断是否已经登录，已经登录，引导进入首页
    let token = localStorage.getItem(Setting.storage.authorizationToken);
    if (!token) this.router.navigate([SettingUrl.ROUTERLINK.pass.login], {replaceUrl: true});//如果没有token，跳转到登录页面

    Setting.MENUS = MENUS;//开发菜单
  }

}
